home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-13 | 966 b | 49 lines | [TEXT/ttxt] |
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- deferred class BENCH
- --
- -- Comparison : ARRAY, FIXED_ARRAY, LINK_LIST and LINK2_LIST.
- --
-
- feature
-
- -- According to the power of your computer, set `tuning'
- -- to a good positive value. Default is for very small
- -- computer :
- tuning: INTEGER is 1; -- 200;
-
- feature {NONE}
-
- count: INTEGER is
- do
- Result := tuning + 1;
- end;
-
- frozen bench(cltn: COLLECTION[INTEGER]) is
- require
- cltn.count = count
- local
- inner, outer, nb_loops, value: INTEGER
- do
- nb_loops := tuning * tuning;
- from
- outer := 1;
- until
- outer > nb_loops
- loop
- from
- inner := cltn.lower;
- until
- inner > cltn.upper
- loop
- value := cltn.item(inner);
- cltn.put(value + 1,inner);
- inner := inner + 1;
- end;
- outer := outer + 1
- end;
- end;
-
- end
-